package edu.rit.drh4818.fire.emitter;

import java.util.Random;



/**
 * Emit a layer of particles with random starting values.
 * 
 * @author Darren Headrick
 *
 */
public class RandomEmitter implements Emitter
{
	public static String NAME = "Random";
	
	/*
	 * (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	public String toString()
	{
		return NAME;
	}

	/*
	 * (non-Javadoc)
	 * @see edu.rit.drh4818.volume.renderer.Emitter#emit(short[][][])
	 */
	public short[][][] emit(short[][][] base) 
	{
		Random r = new Random();
		
		for( int x = 5; x < base.length - 5; x++ )
		{
			for( int z = 5; z < base[x][0].length - 5; z++ )
			{
				base[x][1][z] = (short)(Math.abs( r.nextInt() ) % 255);
			}
		}
		return base;
	}
}
